home *** CD-ROM | disk | FTP | other *** search
/ Acorn RISC PD-CD 1 / Acorn RISC PD-CD 1.iso / utilities / powerbase / pbasedoc / scriptfile < prev    next >
Encoding:
Text File  |  1993-08-02  |  8.5 KB  |  235 lines

  1.                                 Script Files
  2.                                 ============
  3.  
  4. Powerbase incorporates a SCRIPT LANGUAGE which enables you to control some
  5. of its features from a SCRIPT FILE. Using script files you can automate jobs
  6. which need to be done frequently. Print jobs are the most obvious example,
  7. and most of the script commands have to do with printing, but there are
  8. others.
  9.  
  10. Script files are plain text files (created with !Edit) and are executed by
  11. simply dragging them onto the main Powerbase window. All the commands in a
  12. script file must be in upper-case letters, preceded by '!', and may be
  13. followed by a parameter string, separated from the command by a single
  14. space. Here is a full list of the commands followed by a description of
  15. their functions:-
  16.  
  17.         !SCRIPT POWERBASE,END,<filename>
  18.         !COMMENT
  19.         !SELECTION <filename>
  20.         !PRINTOPTS <filename>
  21.         !QUERY <search formula>
  22.         !EXPAND ON,OFF
  23.         !DATE ON,OFF
  24.         !UPPER ON,OFF
  25.         !UNDERLINE ON/OFF
  26.         !CASE ON/OFF
  27.         !INDEX ON/OFF
  28.         !FIRST ON/OFF
  29.         !SHRINK ON/OFF
  30.         !HEADINGS D,T
  31.         !PITCH 5,10,12,17
  32.         !TITLE <title>
  33.         !PAGE 70,66 etc
  34.         !LINESPACE 1,2 etc
  35.         !LMARGIN 1,5,10 etc
  36.         !TMARGIN 1,5,10 etc
  37.         !SPACER <spacer string>
  38.         !COLWIDTH 3,5,10 etc
  39.         !FORMAT HORIZONTAL,VERTICAL,LABEL,TABLExx
  40.         !DESTINATION WINDOW,FILE,PRINTER
  41.         !LABEL n,h,v,l,r,ON/OFF,ON/OFF
  42.         !DELETE <primary key>
  43.         !INSERT (followed by fields, each, inc. 1st, on its own line)
  44.         !IMPRESSION <'Impression' DDF string> [Not first]
  45.  
  46. !SCRIPT
  47. =======
  48. All script files must begin with the line !SCRIPT POWERBASE. This is how the
  49. program distinguishes a Powerbase script from other text files. You should
  50. make !SCRIPT END the last line of the file. Finally, the command can be used
  51. to "chain" another script file by following it with the name of the new
  52. file, i.e. by using the form !SCRIPT <filename>.
  53.  
  54. !COMMENT
  55. ========
  56. Use to insert explanatory comments in a script file. The rest of the line
  57. after the command is ignored.
  58.  
  59. !SELECTION <filename>
  60. =====================
  61. The parameter should be the name of a selection file in the PrintRes
  62. directory. The command will install the selection just as though you had
  63. dragged it from PrintRes to the Powerbase window yourself. If you issue the
  64. command without a parameter the current selection will be cleared.
  65.  
  66. !PRINTOPTS <filename>
  67. =====================
  68. The parameter should be the name of a print options file in the PrintRes
  69. directory. The options will be set just as if the the file had been dragged
  70. from PrintRes to the Powerbase window.  Issued without a parameter causes
  71. the default options to be set.
  72.  
  73. !QUERY <search formula>
  74. =======================
  75. This command is used to print a list. It gives the same result as typing the
  76. search formula into the Match window and clicking OK.
  77.  
  78. !EXPAND
  79. =======
  80. Like many of the commands which follow, this is used to select or deselect a
  81. button in the print options window . !EXPAND ON selects the button which
  82. causes fields to be expanded by reference to a linked validation table. 
  83. !EXPAND OFF (or just !EXPAND by itself) deselects the button.
  84.  
  85. !DATE
  86. =====
  87. Turns date and time stamping ON and OFF. It works in exactly the same way as
  88. !EXPAND.
  89.  
  90. !UPPER
  91. ======
  92. Forces upper-case printing when followed by ON, normal upper/lower case
  93. printing otherwise.
  94.  
  95. !UNDERLINE
  96. ==========
  97. Turns underlining ON and OFF when output is sent to the printer. You will not
  98. see any underlining when the report is displayed in a window by Powerbase,
  99. but underlining will occur when the windowed output is subsequently printed.
  100.  
  101. !CASE
  102. =====
  103. Turns the 'Case specific' button in the Match window ON and OFF.
  104.  
  105. !INDEX
  106. ======
  107. Turns the 'Use index' button in the Match window ON and OFF.
  108.  
  109. !FIRST
  110. ======
  111. Followed by ON this causes any header information, such as date-stamp or
  112. title, to appear on the first page only of a report. When OFF the header is
  113. printed on every page.
  114.  
  115. !SHRINK
  116. =======
  117. Followed by ON this removes surplus "white space" between the columns of
  118. reports in Vertical format.
  119.  
  120. !HEADINGS D
  121. ===========
  122. Causes descriptors to be used as field identifiers in a report. !HEADINGS T,
  123. or without any parameter, causes tags to be used.
  124.  
  125. !PITCH <cpi>
  126. ============
  127. The parameter should be 5, 10, 12 or 17, representing double-width, pica,
  128. elite and condensed respectively.
  129.  
  130. !TITLE
  131. ======
  132. Followed by a text string causes the string to be used as a title on
  133. subsequently printed reports.
  134.  
  135. !PAGE <lines>
  136. =============
  137. Use to set the page length for reports. 70 is correct for A4, 66 for
  138. American letter.
  139.  
  140. !LINESPACE <n>
  141. ==============
  142. Sets the line-spacing to n lines. The default is 1, i.e. no blank lines
  143. between lines of report.
  144.  
  145. !LMARGIN <n>
  146. ============
  147. Sets the left margin to n character spaces
  148.  
  149. !TMARGIN <n>
  150. ============
  151. Sets the top margin to n lines
  152.  
  153. !SPACER <string>
  154. ================
  155. Specifies the string to be used to separate columns of printed data in
  156. reports using 'Horizontal' or 'Table' format.
  157.  
  158. !COLWIDTH <n>
  159. =============
  160. Sets the width of the blank columns used in 'Table' format to n spaces.
  161.  
  162. !FORMAT
  163. =======
  164. Follow this command with HORIZONTAL, VERTICAL, LABEL or TABLE. In the last
  165. case the number of columns required must be appended as a second parameter,
  166. e.g. TABLE 8.  If any other parameter is used, or !FORMAT is issued by
  167. itself, the HORIZONTAL format is used.
  168.  
  169. !DESTINATION
  170. ============
  171. Should be followed with WINDOW or FILE or PRINTER. The first causes reports
  172. to be displayed in a window, from which they may be subsequently saved. FILE
  173. causes output to be sent to a text file specified by the user. PRINTER
  174. causes output to go directly to the printer without being previously
  175. displayed or saved.
  176.  
  177. !LABEL
  178. ======
  179. This is used to define a label specification to use with the LABEL format.
  180. It requires 7 parameters, separated by commas:
  181.  
  182.     (1) The number of labels across the page (1,2 or 3)
  183.     (2) The horizontal label pitch (i.e. left edge to left edge) in inches.
  184.         This is only meaningful when (1) is 2 or 3.
  185.     (3) The vertical label pitch in inches.
  186.     (4) The number of lines to be printed on each label.
  187.     (5) The line which is to be replaced, if blank, by the last field in
  188.         the selection. If nothing is entered here (2 commas together) then
  189.         no substitution is performed.
  190.     (6) If ON is entered the the primary key will appear on the label (in
  191.         brackets) as an identifier.
  192.     (7) If ON is entered blank fields will be skipped when printing.
  193.  
  194. !DELETE <key>
  195. =============
  196. This provides a way of deleting records from the database. The parameter
  197. must be the primary key of the record. The benefits of this command may not
  198. be at all obvious. Suppose you have a text file giving details of records
  199. which must be deleted from the database. If such a job is going to occur at
  200. all often it could be worthwhile to write a customised program to read the
  201. text file and generate the primary key of each record, then output the
  202. results as a Powerbase script file. The whole batch of records can then be
  203. deleted by simply dragging the script into Powerbase. Not worthwhile for ten
  204. records, perhaps, but could be for a hundred. Note that all 6 subfiles will
  205. be searched for the records to be deleted.
  206.  
  207. !INSERT
  208. =======
  209. This is the counterpart of !DELETE and is useful in similar circumstances.
  210. In this case the command must occupy a line by itself and be followed by the
  211. record to insert, one field to a line. It is the user's responsibility to
  212. ensure that the lines are not too long for the database fields into which
  213. they are placed and that the number of lines following each !INSERT is the
  214. same as the number of fields in the record. Don't forget to leave blank
  215. lines for empty fields!                   
  216.  
  217. !IMPRESSION
  218. ===========
  219. Used in conjunction with !QUERY to generate a report in text-file format,
  220. this allows you to insert 'Impression' formatting commands at the start of
  221. the text-file. A script may, for example, execute a series of !QUERY
  222. commands and the resulting files are to be all selected together and dragged
  223. into an 'Impression' document. To make each file go into a new frame you
  224. need to make each begin with {nextframe}. This can be achieved by placing
  225. the script command !IMPRESSION {nextframe} before the first !QUERY. You do
  226. not, however, want {nextframe} to begin the first file created, or the
  227. 'Impression' document will have a blank frame on its first page. To suppress
  228. the effect on the first file use the form: !IMPRESSION {nextframe} Not
  229. first. There must be a space between the '}' and the 'N', but the 'Not
  230. first' string isn't case sensitive.
  231.  
  232.  
  233.  
  234.  
  235.